package hxy.bytecode.algorithm.rsa.insite;

/**
 * @author eric
 * @program bytecode
 * @description 从文件中读取公钥然后加密
 * @date 2022/6/14
 * 「傲寒弘毅: 测试用户：BoschTest
 * 密码：BoschTest@123456」
 * —————————
 */
public class FileRsa {
    public static void main(String[] args) {

        // 读取RSA文件，然后
        String publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmG7bPsOcttEbW/CrXVi+0CLQm0JPONm3o2kcYnVM5EDvsV80fdLXFjh6SmFnuXRAG/Rgb0WOkUqXMiExz1YgKAkvLopxXa5xlLGCmtKF5nKNmjTvq/0Vpl2z4EfhWyb0ezBuOp0b5AMdMpKSBsPzgM0m7JUFPeu1rdcmlIuqXNKoDlgo6caRr9GTEDpYaIHIdAlZiQ6KpFdqe/1TjCpiejdj7NXRt/wKuO9v4AMS54ERqSd3ThfSIMtwxdhwCSwQtpJgLDUQPgFE4fUOOrnIWv9Sl0Ekpj6N1TJ+2RPwCNu6fz9UGjG+xfMsGG+jNn0Iw46vQkAaK6mwaZFEDeSzgQIDAQAB";
//        publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuG7+rLCcMUWGZ7Y31HeIXPxCmrxbZxJFvb4FabZt/2Quh+KgdFolt4ZW3KK5nZY9Y9ka0/1WjqnyYxLmY8vewbAhO7S4e34Y/dPiYygu/0UsQ9vGoLLHT5YYS9x5CzlQGLVGFWW8M+gfw5PFlx4i3UUWO7M0LA10ES7dlkk+zvB2Lbc0I0OMW+oFboKBSzp74soLDDg5Oovsg4JyW/drmqYkI6WXkV2Wac5gOGeq54J9efXqyoVzeVrzlhPdF1oTsJFZGAl/cmsRKiHy1q0hYSNtTIDFG0t/8qlWZC1G8YNl5XzPfbPhWhTzA7qFuVwXDrzZqhuIWWCVpm8A4+FJPwIDAQAB";
        String publicContent = Rsa.encryptByPublicKey("Bosch@123456", publicKey);
        System.out.println("公钥加密：\n" + publicContent);


//        String s = Rsa.decryptByPublicKey("WtFjVv0my08pXZhc9tfX+Shsux1RdA8kd63HUizVPGs/XKA/0nqHuFzxvdqD4F3M8w5U/EPh+yV/CmR+xM96glonz8rJtzpds3P4RZ1l3xkA9Mexi6yi2juggYzPsbntO3ZZHNNCcS3eCf5a6QLA21Pj0l8R53LBx4Vz4PTAW4Dgi/Sbjrj7XLWpCkvVwkN56VkfQmE86o/3mafSTA25UUqTgg9Je/vlLByDIiaUNEJwW/d1VxCHJe6vgQ+wdRUIHfssZsR+TfTZ7JFJK3q8uMEj7Rw3yANiN3kd4PWZosiFyhWirQ0yG94sOwCKJ3i1nWed4n0RL8RQ0Vrgjw+Gng==", publicKey);
//        System.out.println("公钥解密：\n" + s);


    }
}

//https://sourcecode.socialcoding.bosch.com/projects/PUT/repos/put_application_service/browse

//https://sourcecode.socialcoding.bosch.com/projects/PUT/repos/put_verification_service/browse